<% if @corosync_version == '2' -%>
compatibility: whitetank

quorum {
  provider: corosync_votequorum
   <% if @corosync_nodes.length  == 2 -%>
     two_node: 1
   <% else -%>
     two_node: 0
   <% end -%>
}

nodelist {
<% @corosync_nodes.each do |name, node| -%>
  node {
    # <%= name %>
    ring0_addr: <%= node['ip'] %>
    nodeid: <%= node['id'] %>
  }
<% end -%>
}
<% end -%>

totem {
  version:                             2
  token:                               3000
  token_retransmits_before_loss_const: 10
  join:                                60
  consensus:                           3600
  vsftype:                             none
  max_messages:                        20
  clear_node_high_bit:                 yes
  rrp_mode:                            <%= @rrp_mode %>
  secauth:                             <%= @enable_secauth_real %>
  threads:                             <%= @threads_real %>
  transport:                           udpu
  interface {
    ringnumber:  0
    bindnetaddr: <%= @bind_address_real %>
    mcastport:   <%= @port_real %>
<% if @ttl -%>
    ttl:         <%= @ttl %>
<% end -%>
  }
}

logging {
  fileline:        off
  to_stderr:       no
  to_logfile:      no
  logfile:         /var/log/corosync.log
  to_syslog:       yes
  syslog_facility: daemon
  syslog_priority: info
  debug:           <%= @debug ? 'on' : 'off' %>
  function_name:   on
  timestamp:       on
  logger_subsys {
    subsys: AMF
    debug:  off
    tags:   enter|leave|trace1|trace2|trace3|trace4|trace6
  }
}

amf {
  mode: disabled
}

aisexec {
  user:  root
  group: root
}
